<?php
include('config.php');
$type_name = isset($_POST['type_name']) ? $_POST['type_name'] : '';
$rs = $mysql->selectCount('type',"type_name='{$type_name}'");
if($rs){
	echo "0";
}else{
	//$sql = "INSERT INTO  `mz`.`type` (`type_id` ,`type_name`) VALUES (NULL ,  '{$type_name}');";
	$data = array('type_name'=>$type_name);
	$result = $mysql->insert('type',$data);
	if($result){
		echo "1";
	}else{
		echo "-1";
	}
}